package com.tree.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.ToString;

import java.util.List;
@TableName("treemenu")
@Data
@ToString
public class Menu {
    // 菜单id
    @TableId
    private String id;
    // 菜单名称
    private String title;
    // 父菜单id
    @TableField("parentId")
    private String parentId;
    // 菜单url
    private String url;
    // 菜单图标
    private String icon;
    // 子菜单
    @TableField(exist = false)
    private List<Menu> children;
    public Menu(String id,String parentId,String title,String url,String icon) {
        this.id=id;
        this.parentId=parentId;
        this.title=title;
        this.url=url;
        this.icon=icon;
    }


    // 使用了Data注解省去getter和setter方法以及toString方法
}
